#pragma once

#include "node.h"

namespace ann
{

class node_bp: public node
{
public:
    node_bp(const UINT pInCnt, const EXCIT_FUNC pExFunc = &Tansig)
    : node(pInCnt, pExFunc),
      m_weight(NULL)
    {
        m_weight = new double[m_inCnt];
        std::fill(m_weight, m_weight+m_inCnt, 0.0);
    }

    virtual ~node_bp(void)
    {
        SAFE_DELA(m_weight);       
    }

    const double tick(const double* pInVec, const UINT pInCnt); 

public:
    const UINT UpdateW(const double pAlpha, const double pDelta);

public:
    ACCESSOR_IDX(m_weight, double)
    GETBEGIN(m_weight, double)   
    GETENDER(m_weight, m_inCnt, double)

private:
    double* m_weight;
};

}
